package com.gict.antifraudback.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gict.antifraudback.entity.Article;
import com.gict.antifraudback.entity.User;

import java.util.List;

public interface UserService extends IService<User> {

    /**
     * 后端校验toke
     * @param token
     * @return
     */
    User backQueryUserByToken(String token);

    /**
     * 前端校验toke
     * @param token
     * @return
     */
    User frontQueryUserByToken(String token);

    /**
     * 后台生成token
     * @param id
     * @return
     */
    String crateBackToken(Integer id);
    /**
     * 前台生成token
     * @param id
     * @return
     */
    String crateFrontToken(Integer id);

    /**
     * 后台登录通过账号密码
     * @param username
     * @param password
     * @return
     */
    User login(String username, String password);

    /**
     * 前台登录通过email
     * @param email
     * @param password
     * @return
     */
    User forntLogin(String email, String password);

    User getByEmail(String email);

    void setUserName(List<Article> records);
}